Repository navigation
fix(atlas): keep identical split pieces from tripping the shard's UNIQUE hash - #10897
Merged
Merged
Conversation
…QUE hash The aggregator's shard table has `content_hash TEXT UNIQUE`. A chunk that repeats a block splits into identical pieces, and two items can stage the same file, so promotion failed with "UNIQUE constraint failed". The first piece with a given text keeps its plain hash; a repeat gets a hash derived from the text hash, item id and chunk index. Every piece is still kept, so each item's pieces still partition its text. Refs #10836 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: promoting a staged unit failed with
UNIQUE constraint failed: chunks.content_hashwhenever two pieces had the same text. That happens when a file repeats a block and the embed-time split (#10836) cuts it into identical pieces, or when two items in one unit stage the same file.After: promotion keeps every piece. The first piece with a given text keeps the plain SHA-256 of its text; a repeat gets a hash derived from that hash, its item id and its chunk index, so each item's pieces still read back to its exact text.
How: a
unique_piece_hashhelper tracks hashes used in the shard. New testpromotion_keeps_pieces_and_items_with_identical_textstages two identical files that each split into three identical pieces; it fails on main with the UNIQUE error and passes here.cargo test -p atlas-corepasses in full.Refs #10836
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.